# -*- coding=utf-8 -*-

from functools import wraps


def my_decorator(func):
    # @wraps(func)
    def wrapper(*args, **kwargs):
        print(args)
        print(kwargs)
        print('Calling decorated function...')

        return func(*args, **kwargs)

    return wrapper


# @my_decorator
def example(arg='arg', kw1='kw1', kw2='kw2'):
    """Docstring"""
    if arg is None:
        arg = 'default arg'
    if kw1 is None:
        kw1 = 'default kw1'
    if kw2 is None:
        kw2 = 'default kw2'
    print(arg)
    print('Called example function')

@my_decorator
def example2(arg, kw1, kw2):
    """Docstring"""
    if arg is None:
        arg = 'default arg'
    print(arg)
    print('Called example function')

print(example.__name__, example.__doc__)
print(example())

print('-' * 20)

f = my_decorator(example)('cc', kw1='kw10', kw2='kw20')
print(f)

print('=' * 20)

f2 = example2('cc', kw1='kw11', kw2='kw22')
print(f2)
